<!DOCTYPE html>
<html lang="en" class="md device-pixel-ratio-3 device-retina device-desktop device-windows support-position-sticky">

<head>
    <meta charset="utf-8" />
    <meta name="theme-color" content="#000000" />
    <meta name="viewport"
        content="width=device-width,user-scalable=no,initial-scale=1,maximum-scale=1,minimum-scale=1" />
    <link rel="apple-touch-icon" href="favicon.ico" />
    <meta name="apple-mobile-web-app-title" content="坏坏漫画" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="referrer" content="never">
    <SCRIPT language=javascript>
        function click() { if (event.button == 2) { alert('大神别搞啦'); } } document.onmousedown = click
    </SCRIPT>
    <script>
        //debug调试时跳转页面
        var element = new Image();
        Object.defineProperty(element, 'id', { get: function () { window.location.href = "https://www.baidu.com" } });
        console.log(element);
    </script>
    <script>

        if (("standalone" in window.navigator) && window.navigator.standalone) {

            var noddy, remotes = false;

            document.addEventListener('click', function (event) {

                noddy = event.target;

                while (noddy.nodeName !== "A" && noddy.nodeName !== "HTML") {

                    noddy = noddy.parentNode;

                }

                if ('href' in noddy && noddy.href.indexOf('http') !== -1 &&

                    (noddy.href.indexOf(document.location.host) !== -1 || remotes)) {

                    event.preventDefault();

                    document.location.href = noddy.href;

                }

            }, false);

        }

    </script>
    <script>
        ! function () {
            var h = window,
            e = h.flex = function (e, i, t) {
                var n = e || 100,
                a = i || 1,
                o = h.document,
                d = navigator.userAgent,
                c = d.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i),
                r = d.match(/U3\/((\d+|\.){5,})/i),
                l = r && 80 <= parseInt(r[1].split(".").join(""), 10),
                m = navigator.appVersion.match(/(iphone|ipad|ipod)/gi),
                s = h.devicePixelRatio || 1;
                m || c && 534 < c[1] || l || (s = 1), t && (s = 1); var p = 1 / s,
                    u = o.querySelector('meta[name="viewport"]');
                u || ((u = o.createElement("meta")).setAttribute("name", "viewport"), o.head.appendChild(u)), u.setAttribute("content", "width=device-width,user-scalable=no,initial-scale=" + p + ",maximum-scale=" + p + ",minimum-scale=" + p), o.documentElement.style.fontSize = n / 2 * s * a + "px"
            },
            i = 2,
            t = -1 < h.location.search.indexOf("scale=normal");
            h !== h.top && 1 === h.devicePixelRatio ? e(100, i *= h.document.documentElement.scrollWidth / 375, !!t) : navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i) ? e(100, i *= h.screen.availWidth / 375, !!t) : (h.document.documentElement.classList.add("device-pc"), e(100, i, !0))
        }()
    </script>
    <link rel="shortcut icon" href="./favicon.ico" />
    <title>书架</title>
    <link href="css/main.48b4036a.css" rel="stylesheet">
    <link href="css/aui.css" rel="stylesheet" />
    <script type="text/javascript" src="js/jquery-3.3.1.min.js"></script>
    <script type="text/javascript" src="js/layer.js"></script>
    <script type="text/javascript" src="js/jquery.lazyload.min.js"></script>
    <script type="text/javascript" src="js/template-web.js"></script>
    <script type="text/javascript" src="js/aui-toast.js"></script>
    <script type="text/javascript" src="js/aui-dialog.js"></script>
    <script type="text/javascript" src="js/config.js" charset="utf-8"></script>
</head>

<body>
    <div id="root" style="height: 100%;">
        <div id="framework7-root" class="framework7-root">
            <div class="panel-backdrop"></div>
            <div class="panel panel-left panel-reveal">
                <div id="chapterDirectory" class="page">
                    <div class="page-content">
                        <div class="block-title">目录</div>
                        <div class="no-margin-bottom list virtual-list">
                            <ul id="leftpannel" style="height: 5667.84px;">
                                <li class="bg-color-default text-color-primary"
                                    style="height: 0.48rem; top: 0px; font-size: 110%; font-weight: 700;"><a
                                        class="item-link" href="#">
                                        <div class="item-content">

                                            <div class="item-inner">
                                                <div class="item-title">第1話-&lt;1&gt;</div>
                                            </div>
                                        </div>
                                    </a></li>

                            </ul>
                        </div>
                    </div>
                </div>
            </div>
            <div class="panel panel-right panel-reveal">
                <!-- 侧边栏 -->
                <div class="page" id="right-page">
                    <script>
                        $("#right-page").load("right-page.html");
                    </script>
                </div>
            </div>
            <div class="view view-main">

                <style>
                    .mytab {
                        display: block !important;
                        text-align: center;
                    }

                    .delete-btn {
                        cursor: pointer;
                    }
                </style>
                <div class="view view-main">
                    <div class="reader-index page page-current tabs" data-name="reader">
                        <div class="reader-index-toolbar toolbar toolbar-bottom-md tabbar tabbar-labels color-white">
                            <div class="toolbar-inner">
                                <a class="tab-link " href="/index.html" data-route-tab-id="home">
                                    <div class="reader-index-toolbar-icon">
                                        <i class="icon_tj"></i>推荐
                                    </div>
                                </a>
                                <a class="tab-link " href="/cate.html" data-route-tab-id="category">
                                    <div class="reader-index-toolbar-icon">
                                        <i class="icon_fl"></i>分类
                                    </div>
                                </a>
                                <a class="tab-link tab-link-active" href="/favorite.html" data-route-tab-id="bookshelf">
                                    <div class="reader-index-toolbar-icon">
                                        <i class="icon_wdmh"></i>我的漫画
                                    </div>
                                </a>
                                <a class="tab-link" href="/user.html" data-route-tab-id="personal">
                                    <div class="reader-index-toolbar-icon">
                                        <i class="icon_zh"></i>账号
                                    </div>
                                </a>
                                <span class="tab-link-highlight"
                                    style="width: 25%; transform: translate3d(0%, 0px, 0px);"></span>
                            </div>
                        </div>
                        <div class="tabs-animated-wrap">
                            <div class="tabs" style="transform: translate3d(-200%, 0px, 0px);">
                                <div id="home" class="page-content tab"></div>
                                <div id="category" class="page-content tab"></div>
                                <div id="bookshelf" class="page-content tab tab-active">
                                    <div class="page" data-name="readerBookshelf">
                                        <div class="navbar color-white">
                                            <div class="navbar-inner sliding">
                                                <div class="toolbar tabbar color-white">
                                                    <div class="toolbar-inner">
                                                        <a class="link tab-link tab-link-active" href="/favorite.html"
                                                            data-tab="#reader-bookshelf-tab-1-1552380767503">我的书架</a>
                                                        <!-- <a class="link tab-link" href="/home/user/history.html"
                                                            data-tab="#reader-bookshelf-tab-2-1552380767503">阅读记录</a> -->
                                                        <span class="tab-link-highlight"
                                                            style="width: 50%; transform: translate3d(0%, 0px, 0px);"></span>
                                                    </div>
                                                </div>
                                                <div class="right">
                                                    <a class="icon-big link icon-only" href="/search.html">
                                                        <i class="icon material-icons">search</i>
                                                    </a>
                                                </div>
                                            </div>
                                        </div>
                                        <div class="page-content hide-navbar-on-scroll">
                                            <div class="tabs-animated-wrap">
                                                <div class="tabs">
                                                    <div id="reader-bookshelf-tab-1-1552380767503"
                                                        class="tab tab-active" style="overflow-y: auto;">
                                                        <div class="no-margin list">
                                                            <ul>
                                                                <li class="">
                                                                    <div class="item-content">
                                                                        <div class="item-inner">
                                                                            <div>
                                                                                <i
                                                                                    class="margin-right-sm icon material-icons color-gray">book</i>我的书架
                                                                            </div>
                                                                            <!--<div><a class="link color-gray" href="#">编辑</a></div>-->
                                                                        </div>
                                                                    </div>
                                                                </li>
                                                                <li class="">
                                                                    <div class="item-content">
                                                                        <div class="item-inner">
                                                                            <div
                                                                                class="width-100 justify-content-start row no-gap">

                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </li>
                                                                <li>
                                                                    <div id="personal" class="page-content tab mytab"
                                                                        lastpage="false" onclick="loadMore()"
                                                                        style="padding: 10px 2px;"></div>
                                                                </li>
                                                            </ul>
                                                        </div>
                                                    </div>
                                                    <div id="reader-bookshelf-tab-2-1552380767503" class="tab"
                                                        style="overflow-y: auto;">
                                                        <div class="no-margin list">
                                                            <ul>
                                                                <li class="">
                                                                    <div class="item-content">
                                                                        <div class="item-inner">
                                                                            <div>
                                                                                <i class="margin-right-sm icon material-icons color-gray">chrome_reader_mode</i>阅读记录 (0)
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </li>
                                                                <li class="">
                                                                    <div class="item-content">
                                                                        <div class="item-inner">
                                                                            <div
                                                                                class="width-100 justify-content-start row no-gap">
                                                                                <div class="text-align-center width-100 block"
                                                                                    style="margin-top: 30vh;"><i
                                                                                        class="icon material-icons color-gray"
                                                                                        style="font-size: 5em;">storage</i>
                                                                                    <p  class="text-color-gray text-align-center"> 暂无阅读记录~</p>
                                                                                </div>
                                                                            </div>
                                                                        </div>
                                                                    </div>
                                                                </li>

                                                            </ul>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>
                                        </div>
                                    </div>
                                </div>
                                <div id="personal" class="page-content tab" lastpage="false" onclick="loadMore()"></div>
                            </div>
                        </div>
                    </div>
                </div>
                <script type="text/html" id="one_list_item">
                    {{each data value i}}
                    <div class="col-33 media-list-item" data-id="{{value['id']}}">
                        <div class="reader-bookshelf-book" >
                            <div class="cover">
                                {{if value['id']}}
                                <span class="link delete-btn" onclick="deleteBook(this, {{value['bookId']}})"><i
                                        class="icon material-icons color-gray">clear</i></span>
                                {{/if}}
                                <a href="/book.html?id={{value['bookId']}}">
                                    <img src="{{value['image']}}" alt="">
                                </a>
                                {{if value['mhstatus']==0}}
                                <span class="status" data-status="serialized">连载</span>
                                {{/if}}
                                {{if value['mhstatus']==1}}
                                <span class="status" data-status="finish">完结</span>
                                {{/if}}
                                <a href="/book.html?id={{value['bookId']}}">
                                    <span class="type" data-type="cartoon"></span>
                                </a>
                            </div>
                            <a href="/book.html?id={{value['bookId']}}">
                                <span class="name">{{value['title']}}</span>
                            </a>
                        </div>
                    </div>
                    {{/each}}
                </script>
            </div>
            <div class="framework7-modals"></div>
            <div class="actions-backdrop"></div>
            <div class="dialog-backdrop"></div>
            <div class="dialog dialog-buttons-1 dialog-buttons-vertical reader-copy-modal modal-in"
                style="display: none; margin-top: -372px;">
                <div class="dialog-inner">
                    <div class="dialog-title"></div>
                    <div class="dialog-text"></div>
                    <input id="foo" type="link" value="" readonly="">
                </div>
                <div class="dialog-buttons">
                    <span class="dialog-button dialog-button-bold text-align-center text-color-primary"
                        data-clipboard-action="copy" data-clipboard-target="#foo">复制链接</span>
                </div>
            </div>
            <div class="popover-backdrop"></div>
            <div class="toast">
                <div class="toast-content">
                    <div class="toast-icon"></div>
                    <div class="toast-text"></div>
                    <a class="toast-button"></a>
                </div>
            </div>
        </div>
    </div>
    <script type="text/javascript" src="js/yymh.js"></script>
    <script src="js/clipboard.min.js"></script>

    <script type="text/javascript" src="js/framework7.min.js"></script>
    <script type="text/javascript">
        window.page = 1;
        window.loading = false;
        function doGetFavoriteData(cate, callback) {
            appCenter.doHeaderPost(baseApi + "/carton/app/favorite",{pageNum:window.page,pageSize:9},{'authToken':localStorage.getItem("authToken")},function (data) {
            if (data.code == 0) {
                showData(data);
            }else{
                appCenter.showFailToast('请求失败');
            }
        })
        }
        //初始化书架数据
        function initFavoriteData() {
            appCenter.showLoadingToast('加载中...');
            doGetFavoriteData(1, function (data) {
                showData(data);
            });
        }

        function showData(data){
            var html = template("one_list_item", data);
            //是否添加
            if (window.page <= 1) {
                $('.justify-content-start').html(html);
            } else {
                $('.justify-content-start').append(html);
            }
            //是否到底
            if (data.data.length<9) {
                $('#personal').attr('lastpage', 'true');
                $('#personal').text('数据到底');
            } else {
                $('#personal').attr('lastpage', 'false');
                $('#personal').text('点击加载更多');
                window.page++;
            }
            window.toast.hide()
        }
        //删除订阅书本
        function deleteBook(that, id) {
            appCenter.doHeaderPost(baseApi + "/carton/app/unsubscribe",{bookId:id},{'authToken':localStorage.getItem("authToken")},function (data) {
                $(that).parents('.media-list-item').remove();
                if (data.code == 0) {
                    toastMsg('删除成功');
                } else {
                    toastMsg('删除失败');
                }
            })
            return false;
        }
        function loadMore() {
            if ($('#personal').attr('lastpage') == "true") { return; }
            doGetFavoriteData(1, window.page, function (data) {
                var html = template("one_list_item", data);
                //是否添加
                if (window.page <= 1) {
                    $('.justify-content-start').html(html);
                } else {
                    $('.justify-content-start').append(html);
                }
                //是否到底
                if (data.data.length<9) {
                    $('#personal').attr('lastpage', 'true');
                    $('#personal').text('数据到底');
                } else {
                    $('#personal').attr('lastpage', 'false');
                    $('#personal').text('点击加载更多');
                    window.page++;
                }
                window.toast.hide();

            });
        }
        //初始化
        $(function () {
            initFavoriteData();
        });
    </script>

</body>

</html>